/**
 * 
 */
package com.taobao.wolfwolf.hibernate.dao.impl;

import java.util.List;

import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import com.taobao.wolfwolf.hibernate.dao.HistoryDao;
import com.taobao.wolfwolf.hibernate.pojo.History;

/**
 * @author Tux
 *
 * 创建时间: 2011-5-20 上午11:58:41
 */
public class HistoryDaoImpl extends HibernateDaoSupport implements HistoryDao {

	/* (non-Javadoc)
	 * @see com.taobao.wolfwolf.hibernate.dao.HistoryDao#findAll()
	 */
	@SuppressWarnings("unchecked")
	public List<History> findAll() {
		return getHibernateTemplate().find("from History");
	}

	/* (non-Javadoc)
	 * @see com.taobao.wolfwolf.hibernate.dao.HistoryDao#save(com.taobao.wolfwolf.hibernate.pojo.History)
	 */
	public void save(History history) {
		getHibernateTemplate().save(history);
	}

	@SuppressWarnings("unchecked")
	public List<History> findByName(String name) {
		return this.getHibernateTemplate().find("from Material as m where m.name=?", name);
	}

}
